package cn.bone.ou.vote.mapper;

import cn.bone.ou.vote.bean.VoteResult;
import cn.bone.ou.vote.dto.VoteDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface VoteResultMapper extends BaseMapper<VoteResult> {

    /**根据投票id删除*/
    int delteByVoteId(@Param("voteId")Integer voteId);

    /**获取结果统计列表*/
    List<VoteDto.ResultDetailDto> listResultDetail(@Param("voteId")Integer voteId);

    /**获取全部投票列表*/
    List<VoteDto.MemberDetailDto> listMemberDetail(@Param("voteId")Integer voteId,
                                                   @Param("start")Integer start,
                                                   @Param("num")Integer num);

    /**获取全部投票总数*/
    int countListMemberDetail(@Param("voteId")Integer voteId);

    /**根据投票id和用户id查询用户的投票*/
    List<VoteDto.MemberVoteDetailDto> listMemberVoteDetail(@Param("voteId")Integer voteId,
                                                           @Param("userId")Integer userId);
}
